let conf_output = "n"
let conf_lang = "fr"

let fail m e = 
  let a, b = string_of_int (fst e), string_of_int (snd e) in
  let mes = (match (m,conf_lang, conf_output) with
    | ((en, fr), "fr", "n") -> (fr^", a la ligne "^a^", caractere "^b)
    | ((en, fr), "en", "n") -> (en^", on line "^a^", characters "^b)
    | ((en, fr), "fr", "p") -> (a^"|"^b^"|"^fr)
    | ((en, fr), "en", "p") -> (a^"|"^b^"|"^en)
    | _ -> "Configuration error"
 	    )
  in failwith mes


let find_h h v te err = 
  try Hashtbl.find h v with _ -> fail te err

(* Lit un fichier dans son ensemble *)
let read f = 
  let rec aux s f = 
    try aux (s^(input_line f)^"\n") f  
    with _ -> s
  in aux "" (open_in f)
